program iii;

{$APPTYPE CONSOLE}
type

  TDeputy = record
    calmness: Integer;
    friendsCount: Integer;
    friends: array[1..100000] of Integer;
    inFight: Boolean;

  end;
var
  i,j,n1, n2, m1, m2, k1, k2: Integer;
  a,b:array[1..100000] of TDeputy;
  p,q:array[1..100000] of Integer;
  x,y: Integer;
begin
  readln(n1, n2);
  for i := 1 to n1 do begin
    read(a[i].calmness);
    a[i].inFight := False;
    a[i].friendsCount := 0;
  end;
  for i := 1 to n2 do begin
    read(b[i].Calmness);
    b[i].inFight := False;
    b[i].friendsCount := 0;
  end;
  readln(m1, m2);
  for i := 1 to m1 do begin
    read(x, y);
    af[x, y]:= True;
    af[y, x]:= True;
  end;
  for i := 1 to m2 do begin
    read(x, y);
    bf[x, y]:= True;
    bf[y, x]:= True;
  end;
  readln(k1, k2);
  for i := 1 to k1 do
    read(p[i]);
  for i := 1 to k2 do
    read(q[i]);
  for i := 1 to k1 do
    aa[p[i]] := True;
  for i := 1 to k2 do
    bb[q[i]] := True;


  for i := 1 to n1 do



  for i := 1 to m2 do
    read(b[i]);


  for i := 1 to n do
  for i := 1 to n1 do
    read(a[i]);
    read(b[i]);
  for i := 1 to n do
    s := s - abs(a[i]-b[i]);
  writeln(s:0:0);
end.
